package lab02.test19;

import java.util.Scanner;

/**
 * Created by 星月 on 2017/10/26.
 */
public class Test {
    public static void main(String[] args) {
        //实现字符串的大小写转换并倒序输出
        String strings = "helloWORLD";// 字符串转成char数组
        char[] ch = strings.toCharArray();
        StringBuffer buffer = new StringBuffer();
        for (int i = strings.length() - 1; i >= 0; i--) {
            if (ch[i] >= 'A' && ch[i] <= 'Z') {
                buffer.append(String.valueOf(ch[i]).toLowerCase());
            } else if (ch[i] >= 'a' && ch[i] <= 'z') {
                buffer.append(String.valueOf(ch[i]).toUpperCase());
            }
        }
        System.out.println(buffer.toString());
    }

}

